/*
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see http://www.gnu.org/licenses/. 
 *
 *  Authors:
 *  	Albert Marieges Garcia
 *  	Álex Pardo Fernández
 *  	Enric Mayas Márquez
 *  	Juan Carlos Calvo Tejedor
 *  	Marc Gironés Dezsényi
 *  
 *  Contact:
 *  	bcn.tours.android@gmail.com
 *  Webpage:
 *  	bcntours.co.cc
 *
 */

package com.BCNTours.Maps.Utils;

import java.util.ArrayList;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

import com.BCNTours.R;
import com.BCNTours.Model.ApplicationData;


public class DetailedRoute extends ListActivity{
	/*Atributions*/
//    private Vector<String> data;
	Bundle extras;
	private ArrayList<String> instructions;
	
	@SuppressWarnings("unused")
	private ApplicationData applicationData;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.categories);
        
        extras = getIntent().getExtras();
        //image = extras.getInt("listImage");
        instructions = extras.getStringArrayList("instr");
 
        //Animation of the screen and set the orientation the screen
        //setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
//        LayoutInflater mInflater = (LayoutInflater) getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        
//        data = new Vector<String>();
        String data [] = new String[instructions.size()];  
        int i = 0;
        for(String tmp : instructions){
        	data[i] = Integer.toString(i+1) +". "+ tmp;
        	i++;
        }
        
        setListAdapter(new ArrayAdapter<String>(this, R.layout.route_element, data));
        
//        ArrayAdapter<String> adapter=  new ArrayAdapter<String>(getApplicationContext(), R.layout.route_element,R.id.detail, data);
        
//        setListAdapter(adapter);
        getListView().setTextFilterEnabled(true);
        
	}
	
	
}
